<!DOCTYPE html>
<html lang="en">
	<head>
		<meta charset="UTF-8" />
		<meta http-equiv="X-UA-Compatible" content="IE=edge" />
		<meta name="viewport" content="width=device-width, initial-scale=1.0" />
		<title>configurable</title>
	</head>
	<body>
		<script>
			let obj = {}
			Object.defineProperty(obj, 'name', {
				value: 'jack',
				configurable: true, // 是否可以删除属性
				writable: false, // 只读，不能修改name属性
				enumerable: true, // for-in遍历属性
			})

			console.log(obj)
			// delete obj.age  //删除
			obj.name = 'rose' // 修改
			console.log(obj)

			//遍历
			for (const key in obj) {
				console.log(key, obj[key])
			}
		</script>
	</body>
</html>
